export class OIMOHelper {

    private static _cacheRigPos: OIMO.Vec3 = new OIMO.Vec3();
    private static _cacheRigRot: OIMO.Quat = new OIMO.Quat();
    private static _cachePos: Laya.Vector3 = new Laya.Vector3();
    private static _cacheRot: Laya.Quaternion = new Laya.Quaternion();

    static SyncTrans(obj: Laya.Sprite3D, rig: OIMO.RigidBody) {
        rig.getPositionTo(this._cacheRigPos);
        rig.getOrientationTo(this._cacheRigRot);
        this._cachePos.setValue(this._cacheRigPos.x, this._cacheRigPos.y, this._cacheRigPos.z);
        this._cacheRot.x = this._cacheRigRot.x;
        this._cacheRot.y = this._cacheRigRot.y;
        this._cacheRot.z = this._cacheRigRot.z;
        this._cacheRot.w = this._cacheRigRot.w;
        obj.transform.position = this._cachePos;
        obj.transform.rotation = this._cacheRot;
    }

}